# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
pkgname=postgresql-common
pkgver=1.1
pkgrel=0
pkgdesc="Common files for PostgreSQL"
url="https://www.postgresql.org/"
arch="noarch"
license="MIT"
install="$pkgname.pre-install $pkgname.pre-deinstall"
triggers="$pkgname.trigger=/usr/libexec/postgresql*:/usr/share/postgresql*"
subpackages="$pkgname-openrc"
source="pg_versions
	postgresql.initd
	postgresql.confd
	"
builddir="$srcdir"
options="!check"  # no tests

# secfixes:
#   0:
#     - CVE-2019-3466

package() {
	mkdir -p "$pkgdir"

	install -D -m755 "$srcdir"/pg_versions "$pkgdir"/usr/sbin/pg_versions

	install -D -m755 "$srcdir"/postgresql.initd "$pkgdir"/etc/init.d/postgresql
	install -D -m644 "$srcdir"/postgresql.confd "$pkgdir"/etc/conf.d/postgresql
}

openrc() {
	default_openrc
	replaces="postgresql-openrc"  # for backward compatibility
}

sha512sums="
f9887e260bbcccb1a96030d3065459f1c0b4b8c50e62008ab1e0964e5b281de330e3d25b311eb88a729c23342193bedb3549913b24facd4f39c1398f819c0d8c  pg_versions
41590b3009c2d6e3b215bd8f1fa7f06a15c382a7609b60b171dae67dd7b5f71e651a2d3f6a8af0e9376ca94200ded745ae864f0b34565c6ccd7857389574e9e5  postgresql.initd
611cca04bdf97284bca2c85688e3512dd5fcce2c1d40dcf2082855008cbe988dccbdc589af5021a120b2de10455b3700712f99d1b60da1e10ee953516f030db5  postgresql.confd
"
